package org.corey.wyp.business
{
	import com.adobe.cairngorm.business.ServiceLocator;
	
	import mx.controls.Alert;
	import mx.rpc.IResponder;
	
	import org.corey.wyp.vo.AccountItem;
	import org.corey.wyp.vo.MonthSetting;
	import org.corey.wyp.vo.SettingTemplate;
	
	public class PropertyManagerDelegate
	{
		private var _responder:IResponder;
		private var _service:Object;
	
		public function PropertyManagerDelegate(responder:IResponder)
		{
			_service=ServiceLocator.getInstance().getService(Services.PROPERTY_MANAGER);
			this._responder=responder;
		}
		
		public function testConnection(seedText:String):void{
			var call:Object=_service.testConnection(seedText);
			call.addResponder(_responder);
		}
		
		public function getServerTime():void{
			var call:Object=_service.getServerTime();
			call.addResponder(_responder);
		}
		
		public function saveAccountItem(accountItem:AccountItem):void{
			Alert.show("client:saveAccountItem");
			var call:Object=_service.saveAccountItem(accountItem);
			call.addResponder(_responder);
		}
		
		public function removeAccountItem(ids:Array):void{
			Alert.show("client:removeAccountItem");
			Alert.show(ids.toString()+"length");
			var call:Object=_service.removeAccountItem(ids);
			call.addResponder(_responder);
		}
		
		public function getCalendarAccount(year:int,month:int,date:int):void{
			Alert.show("client:getCalendarAccount "+year+"-"+month+"-"+date);
			var call:Object=_service.getCalendarAccount(year,month,date);
			call.addResponder(_responder);
		}
		
		public function getMonth(year:int,month:int):void{
			Alert.show("client:getMonth");
			var call:Object=_service.getMonth(year,month);
			call.addResponder(_responder);
		}
		
		public function getMonthSetting(year:int,month:int):void{
			Alert.show("client:getMonthSetting");
			var call:Object=_service.getMonthSetting(year,month);
			call.addResponder(_responder);
		}
		
		public function saveMonthSetting(monthSetting:MonthSetting):void{
			Alert.show("client:saveMonthSetting");
			var call:Object=_service.saveMonthSetting(monthSetting);
			call.addResponder(_responder);
		}
		
		public function saveSettingTemplate(settingType:String,settingTemplate:SettingTemplate):void{
			Alert.show("client:saveSettingTemplate");
			var call:Object=_service.saveSettingTemplate(settingType,settingTemplate);
			call.addResponder(_responder);
		}
		
		public function getSettingTemplate(settingType:String):void{
			Alert.show("client:getSettingTemplate");
			var call:Object=_service.getSettingTemplate(settingType);
			call.addResponder(_responder);
		}
	}
}